package com.xiaobai.bo;

import com.xiaobai.common.FreeClassroomEnum;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @description: 校区
 * @author: 小白白
 * @create: 2021-11-26
 **/

@Data
public class FreeClassroomCampus {

    /**
     * 校区名
     */
    private String name;

    /**
     * 各个楼
     */
    private Map<String, FreeClassroomBuilding> map;

    public FreeClassroomCampus(String name) {
        this.name = name;
        this.map = new HashMap<>();
        if (name.equals(FreeClassroomEnum.GH.name)) {
            this.map.put(FreeClassroomEnum.YIHAOLOU.name, new FreeClassroomBuilding(FreeClassroomEnum.YIHAOLOU.name));
            this.map.put(FreeClassroomEnum.ERHAOLOU.name, new FreeClassroomBuilding(FreeClassroomEnum.ERHAOLOU.name));
            this.map.put(FreeClassroomEnum.SANHAOLOU.name, new FreeClassroomBuilding(FreeClassroomEnum.SANHAOLOU.name));
        } else if (name.equals(FreeClassroomEnum.GD.name)) {
            this.map.put(FreeClassroomEnum.ZHUJIAO.name, new FreeClassroomBuilding(FreeClassroomEnum.ZHUJIAO.name));
            this.map.put(FreeClassroomEnum.ERJIAOA.name, new FreeClassroomBuilding(FreeClassroomEnum.ERJIAOA.name));
            this.map.put(FreeClassroomEnum.ERJIAOB.name, new FreeClassroomBuilding(FreeClassroomEnum.ERJIAOB.name));
        } else{
            this.map.put(FreeClassroomEnum.ZONGHE.name, new FreeClassroomBuilding(FreeClassroomEnum.ZONGHE.name));
        }
    }

}
